<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>state </title>
</head>

<body>
    <div id="app"></div>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <!-- 专门设置props的库 -->
    <script src="../js/prop-types.js"></script>
    <script src="../js/babel.min.js"></script>
    <script type="text/babel">
        // vue里边的data 60% react 30$ anguler 微信小新程序,
        // 只能是class 使用 func
        class MyData extends React.Component {
            constructor(props) {
                super(props)
                // 和vue的data
                // this.state={
                //     msg:'我是信息'
                // }
            }
            // 可以纯任意的数据 数组,对象,也可以
            state={
                arr:['水','是的','费水电费']
            }
            render() {
                return (
                    <div>{this.state.arr.map((ele,i) => <span key={i}> {ele} </span> )  }</div>
                )
            }
        }
        ReactDOM.render(<MyData />, document.getElementById('app'))
    </script>
</body>

</html>